import { createRouter, createWebHistory } from "vue-router";

const routes = [
    {
        path: "/",
        name: "Home",
        component: () => import("../views/Home.vue"),
    },
    {
        path: "/about/:id/:name/:age?",
        name: "About",
        component: () => import("../views/About.vue"),
    },
    {
        path: "/user",
        name: "User",
        component: () => import("../views/User.vue"),
    },
    {
        path: "/person/:id/:name?/:age?/:gender",
        name: "Person",
        component: () => import("../views/Person.vue"),
        props: true,
    },
    {
        path: "/people/:id/:name?/:age?/:gender",
        // path: "/people",
        name: "People",
        component: () => import("../views/People.vue"),
        props(route) {
            return route.params;
            // return route.query;
        }
    },
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;